/**
 * Copyright (c) 2016-2019 九点科技 All rights reserved.
 *
 * http://www.9dyun.cn
 *
 * 版权所有，侵权必究！
 */
package com.dian.modules.inv.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.dian.common.validator.group.AddGroup;
import com.dian.common.validator.group.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.dian.common.entity.BaseEntity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
/**
 * 调拨单
 *
 * @author xiaolai
 * @email xiaolai@9dyun.cn
 * @date 2019-06-11 00:17:00
 */
@Data
@TableName("inv_tran_head")
public class TranHeadEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;

    /**
	 * 组织ID
	 */
//    @NotNull(message="组织ID不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long tenantId;
    /**
	 * 调拨编码
	 */
    @NotBlank(message="调拨编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="调拨编码长度不能超过20个字符")
    private String tranNo;
    /**
	 * 调拨日期;format:yyyy-mm-dd
	 */
    /**更新时间  用户可以点击更新，保存最新更新的时间。**/
    @JsonFormat(pattern="yyyy-MM-dd")
    @NotNull(message="调拨日期不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Date tranDate;
    /**
     * 调拨月份;format:yyyy-mm
     */
    @JsonFormat(pattern="yyyy-MM")
    @NotNull(message="调拨日期不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private String tranMonth;
    /*@NotNull(message="调拨日期不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Date tranDate;*/
    /**
	 * 调入仓库Id;来源于Base_Warehouse.id
	 */
    @NotNull(message="调入仓库Id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long toWarehouseId;
    /**
	 * 调入仓库编码;来源于Base_Warehouse.Warehouse_Code
	 */
    @NotBlank(message="调入仓库编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="调入仓库编码长度不能超过20个字符")
    private String toWarehouseCode;
    /**
	 * 调入仓库名称;来源于Base_Warehouse.Warehouse_Name
	 */
    @NotBlank(message="调入仓库名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="调入仓库名称长度不能超过40个字符")
    private String toWarehouseName;
    /**
	 * 调出仓库Id;来源于Base_Warehouse.id
	 */
    @NotNull(message="调出仓库Id不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Long fromWarehouseId;
    /**
	 * 调出仓库编码;来源于Base_Warehouse.Warehouse_Code
	 */
    @NotBlank(message="调出仓库编码不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=20,  groups ={AddGroup.class, UpdateGroup.class}, message="调出仓库编码长度不能超过20个字符")
    private String fromWarehouseCode;
    /**
	 * 调出仓库名称;来源于Base_Warehouse.Warehouse_Name
	 */
    @NotBlank(message="调出仓库名称不能为空",  groups ={AddGroup.class, UpdateGroup.class})
    @Length(max=40,  groups ={AddGroup.class, UpdateGroup.class}, message="调出仓库名称长度不能超过40个字符")
    private String fromWarehouseName;
    /**
	 * 单据状态:1-未审核-WAITCHECK;2-已审核-AUDITED-;99-已作废-INVALID
	 */
    @NotNull(message="单据状态不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Integer tranState;
    /**
	 * 审核人ID
	 */
    private Long checkUserId;
    /**
	 * 审核人
	 */
    private String checkUserName;
    /**
	 * 审核时间
	 */
    private Date checkDate;
    /**
	 * 调拨类型:1-正常调拨-NORMAL;2-其它调拨-OTHER
	 */
    @NotNull(message="调拨类型不能为空",groups = {AddGroup.class,UpdateGroup.class})
    private Integer tranType;
    /**
     * 调拨单明细
     */
    @TableField(exist = false)
    private List<TranLineEntity> tranLineEntityList;
}
